//version: 1.0.0 
package testcase;

import junit.framework.TestCase;
import roster.Schedule;


public class TestSchedule extends TestCase{
	public static Schedule x;
	public int noOfRecords=5;
	public String name="test";
	public int date=19022013;
	public String[] staffName={"Eva", "Coach", "Yanis", "Peter", "Marry"};
	public String[][] time={{"ABC", "BC", "AC", "B", "C", "-", "A"},
							{"ABC", "BC", "AC", "B", "C", "-", "B"},
							{"ABC", "BC", "AC", "B", "C", "-", "C"},
							{"ABC", "BC", "AC", "B", "C", "-", "D"},
							{"ABC", "BC", "-", "-", "-", "-", "E"}};

	public void setUp() throws Exception {
		x=new Schedule(noOfRecords,name,date,staffName,time);
	}
	
	public void testGetMethods(){
		assertEquals(noOfRecords, x.getNoOfRecords());
		assertEquals(name, x.getName());
		assertEquals(date, x.getStartDate());
		assertEquals(staffName[4], x.getStaffName()[4]);
		assertEquals(time, x.getTime());
	}
	
	public void testSetMethods(){
		x.setName("testName");
		x.setStartDate(14032013);
		x.setStaffName(0, "Amy");
		x.setTime(4,4, "ABC");
		assertEquals("testName",x.getName());
		assertEquals("Amy", x.getStaffName()[0]);
		assertEquals("ABC", x.getTime()[4][4]);
		assertEquals(14032013, x.getStartDate());
	}
	
	public void testAddStaff(){
		x.addStaff("NewSt");
		assertEquals(x.getStaffName()[5],"NewSt");
		assertEquals(x.getNoOfRecords(),6);
	}
	
	public void testDeleteStaff(){
		x.deleteRecord(0);
		assertEquals(x.getStaffName()[0],"Coach");
		x.deleteRecord(3);
		assertEquals(x.getStaffName()[3],"Marry");
	}
}